package com.bgrconsulting.stockorderentry.service.converter.response;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;


import com.bgrconsulting.stockorderentry.service.model.AccountPosition;
import com.bgrconsulting.stockorderentry.service.model.AccountPositions;
import com.bgrconsulting.stockorderentry.service.model.response.AccountPositionResponse;

import com.bgrconsulting.stockorderentry.service.converter.AccountPositionConverter;
import com.bgrconsulting.stockorderentry.service.converter.AccountPositionsConverter;

@XmlRootElement(name = "accountPositionResponse")
public class AccountPositionResponseConverter {
	
	private AccountPositionResponse enity = null;
	
	public AccountPositionResponseConverter(AccountPositionResponse accountPositionResponse) {
		this.enity = accountPositionResponse;
	}
	
	public AccountPositionResponseConverter() {
		this.enity = new AccountPositionResponse();
	}
	
	@XmlElement(name = "accountId")
	public String getAccountId() {
		return enity.getAccount().getAccountId();
	}
	
	@XmlElement(name = "count")
	public int getCount() {
		return enity.getCount();
	}
	
	@XmlElement(name = "marker")
	public String getMarker() {
		return enity.getMarker();
	}
	
	@XmlElement(name = "accountPositions")
	public AccountPositionsConverter getAccountPositions() {	
		AccountPositionsConverter apc = new AccountPositionsConverter(enity.getAccountPositions());
		return apc;
	}
}
